<template>
	<view class="body">
		<!-- 新增月初计划任务 -->
		<myHeader :title="title"></myHeader>

		<!-- 新增 -->
		<view class="mt-20 p-20">
			<uni-forms :value="formData" ref="form" :rules="rules">
				<uni-forms-item label="用户姓名" name="name">
					<uni-easyinput type="text" v-model="formData.realName" placeholder="请输入任务名" />
				</uni-forms-item>
				<uni-forms-item label="用户电话" name="theme">
					<uni-easyinput type="text" v-model="formData.phone" placeholder="请输入会议主题" />
				</uni-forms-item>

				<view class="mt-20" style="display: flex;justify-content: space-between;">
					<button class="bg-red text-white" @click="submitForm">重置密码</button>
					<button class="bg-red text-white" @click="submitForm">提交</button>
				</view>

			</uni-forms>

		</view>
	</view>
</template>

<script>
	import myHeader from './../components/head.vue'
	import NetWorkTool from '@/api/netWorkTool'
	import axios from 'axios'
	export default {
		data() {
			return {
				title: '修改信息',
				// 表单数据
				formData: {
					name: '',
					theme:'',
					room:'',
					time:'',
					endTime:''
				},
				// 表单验证
				rules: {
					// 对name字段进行必填验证
					name: {
						rules: [{
							required: true,
							errorMessage: '请输入姓名',
						}]
					},
					// 对email字段进行必填验证
					theme: {
						rules: [{
							required: true,
							errorMessage: '请输入主题',
						}]
					},
					room: {
						rules: [{
							required: true,
							errorMessage: '请输会议室',
						}]
					},
				}
			}
		},
		mounted() {
			this.getMembers();
		},
		methods: {
			submitForm() {
				this.$refs.form.submit().then(res => {
					NetWorkTool.POST('/api/federation-start-month/meeting', param, true).then(res => {
						uni.showToast({
							title: res.message,
							duration: 3000
						});
						this.formData = {};
						uni.navigateTo({
							url: './monthStartPlan'
						})
					});
				}).catch(err => {
					uni.showToast({
						title: "请完成信息填写",
						duration: 2000,
						icon: 'none',
					});
				})
			},
		},
		components: {
			myHeader
		},
	}
</script>

<style lang="scss" scoped>
	@import url("/static/party_building/assets/style/federation.css");

	.group {
		border: 1px solid #E5E5E5;
		border-radius: 20upx;
	}
</style>
